"use strict";
const e = require("../../common/vendor.js"),
  a = require("../../api/MenuButton.js"),
  t = require("../../api/request.js"),
  o = require("../../store/index.js"),
  s = require("../../api/qq-Location.js");
require("../../api/qqmap-wx-jssdk.js"), require("../../api/my-account.js"), Math || n();
const n = () => "../Common-components/card-flow.js",
  r = {
    __name: "found",
    setup(n) {
      e.useCssVars((t => ({
        "96fb9534": e.unref(a.MenuButton)().seViewHeight,
        f2c2e1e6: e.unref(a.MenuButton)().top,
        a5c8e32e: e.unref(c).inputBack,
        "8ebf6f22": e.unref(a.MenuButton)().height,
        "4d2f894f": e.unref(a.MenuButton)().left,
        "132a53be": e.unref(c).inputColor
      })));
      const r = o.dataSet();
      let u = e.reactive({
          backgroundColor: "none",
          opacity: 1
        }),
        c = e.reactive({
          inputBack: "rgba(255, 255, 255, 0.2)",
          inputColor: "#ffffff"
        });
      e.onPageScroll((e => {
        e.scrollTop <= 100 ? (u.opacity = 1, u.backgroundColor = "none", c.inputBack = "rgba(255, 255, 255, 0.2)", c.inputColor = "#ffffff") : (u.opacity = e.scrollTop / 140, u.backgroundColor = "#FFFFFF", c.inputBack = "#f6f7f8", c.inputColor = "#666666")
      }));
      const i = e.ref("定位中..."),
        l = e.ref([]),
        f = e.ref([]);
      e.ref(!0);
      const p = e.ref("");
      e.watch((() => r.address), (async a => {
        console.log(a);
        const o = e.wx$1.getStorageSync("location");
        if (o) i.value = o;
        else {
          const a = await s.getLocation();
          i.value = a.city, e.wx$1.setStorageSync("location", a.city)
        }
        i.value = a || i.value;
        const n = await t.requestApi("/local_gameplay");
        l.value = n.data, await async function (e) {
          const a = await t.requestApi("/local_travel", {
            page: 1,
            address: e
          });
          console.log(a), p.value = a.data.length > 0 ? a.data[0].cover_image.url : "https://meituan.thexxdd.cn/lvyou/assets/found-search-back-887c7b56.jpg", f.value = a.data
        }(i.value)
      }), {
        immediate: !0
      });
      const v = e.ref(1);

      function d() {
        e.wx$1.navigateTo({
          url: "/pages/search-city/city"
        })
      }

      function g() {
        e.wx$1.navigateTo({
          url: "/pages/search-travel/search"
        })
      }

      function _() {
        e.wx$1.navigateTo({
          url: "/pages/found/address-image?value=" + i.value
        })
      }
      return e.onReachBottom((async () => {
        v.value++;
        const e = await t.requestApi("/local_travel", {
          page: v.value,
          address: i.value
        });
        f.value = [...f.value, ...e.data]
      })), (a, t) => ({
        a: p.value,
        b: 1 === e.unref(u).opacity ? "/static/icon/found/sousuo-bai.png" : "/static/icon/found/sousuo-hei.png",
        c: e.o(g),
        d: e.s(e.unref(u)),
        e: e.t(i.value),
        f: e.o(d),
        g: e.t(i.value),
        h: e.o(_),
        i: e.s(a.__cssVars()),
        j: e.s(a.__cssVars()),
        k: e.f(l.value, ((a, t, o) => ({
          a: a.image,
          b: e.t(a.categories),
          c: t,
          d: e.o((t => {
            return o = a.categories, void e.wx$1.navigateTo({
              url: `/pages/types-travel/index?type=002&query=${o}&address=${i.value}`
            });
            var o
          }), t)
        }))),
        l: e.s(a.__cssVars()),
        m: e.s(a.__cssVars()),
        n: e.s(a.__cssVars()),
        o: e.p({
          userTravels: f.value
        }),
        p: e.s(a.__cssVars())
      })
    },
    __runtimeHooks: 1
  };
wx.createPage(r);